﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <div id="app" class="popupW100" v-cloak>
        <!-- class="popupW100"为label宽度为100px，共有popupW50、popupW100、popupW150、popupW200可选 -->
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item  prop="CM_ClassName" >
                            <el-input type="text" v-model="Form.CM_ClassName" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{CategoryManagementList0529.CM_ClassName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>


                <el-col :span="24">
                    <el-form-item :label="CategoryManagementList0529.CM_Mark+mark.m" prop="CM_Mark" class="inputTextarea">
                        <!-- 弹出页的其它不能成组的控件添加class="inputTextarea"，达到label与input、select等控件的label对齐的目的 -->
                        <el-input type="textarea" v-model="Form.CM_Mark" autocomplete="off"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var gutid = gutid();//取随机主键
        function gutid() {
            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
                var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
                return v.toString(16);
            });
        };

        //取序号
        var gunstN = parent.$LawRegulationsTable.Arrays.length
        var gutNum = gunstN+1;
        //var gutNum = gutNum();
        //function gutNum() {
        //    ufoiNum = ufoiNum + 1;
        //    return ufoiNum;
        //};

       

        var app = new Vue({
            value1: '',
            el: '#app',
            data: {
                //父业传参
                id: '',
                //获取下拉菜单sex
                sex: [],
                //业务表单内容
                Form: {
                    //id: guidEmpty,
                    id: gutid,
                    CM_Id: gutNum, // '999999',
                    CM_ClassName: '',
                    CM_Person: '测试人',
                    CM_Time: '2019-05-30',
                    CM_Mark: '',
                },
                //表单验证
                rules: {
                    CM_ClassName: [
                        verification.NotNull
                    ],

                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function (formName) {
                    //console.log("xxxxx890xxxxxxx");
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {

                            onSubmitForm(this, '/api/CategoryManagementList/Save', mythis.Form);
                        } else {
                            //验证失败

                            return false;
                        }
                    });
                },
                getData: function () {
                    //console.log("获取编辑数据开始");
                    getData(this, '/api/CategoryManagementList/get?id=' + this.id);
                    //this.Form.sex = this.Form.sex + "";
                    //console.log(this.id);
                    //console.log("获取编辑数据结束");
                }
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
                //获取下拉菜单内容
                //this.sex = getDicData('01');
                //console.log(id);
                //console.log(parent.$LawRegulationsTable.Arrays.length);
                //console.log(this.getData());
                
            }
        });
    </script>
</body>
</html>